import type {TableHeader} from "~/resource/types/common/tableHeader";

export const showTableHeader = (tableHeaders: TableHeader[]): TableHeader[] => {
    return tableHeaders.filter(e => e.show);
}
export const showHeaderKey = (field: string, headers: Array<TableHeader>): Array<TableHeader> => {
    return headers.filter(e =>e.key===field).filter(e => e.show);
}
export const showFilterTableHeader = (tableHeaders: TableHeader[],noShowKeys:string[]): TableHeader[] => {
    return tableHeaders.filter(e => e.show).filter(e=>!noShowKeys.includes(e.key));
}